package com.yunhui.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunhui.entity.Order;
import com.yunhui.entity.PeopleInfo;
import com.yunhui.entity.RouteJb;
import com.yunhui.entity.SubscribePeople;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author
 * @since 2019-12-09
 */
public interface OrderMapper extends BaseMapper<Order> {
    //查询所有订单信息
    public List<Order> findAllOrder();

    //根据用户Id查询订单信息(currentPageNo:第几页；pageSize：每页条数)
    public List<Order> findOrderById(@Param("O_date") String O_date, @Param("sid") Integer sid, @Param("uid") Integer uid,
                                     @Param("currentPageNo") int currentPageNo, @Param("pageSize") int pageSize);

    //商家---根据商家id 查询订单信息
    public List<Order> findOrderBysjId(@Param("O_date")String O_date,@Param("title") String title,@Param("sjId") Integer sjId,
                                       @Param("currentPageNo")int currentPageNo, @Param("pageSize")int pageSize);

    //商家---查詢当前商家的今日訂單  id 为当前商家登录的id
    public List<Order> findTodayOrder(@Param("sjid") Integer sjid);

    //商家---加载行程信息
    public List<RouteJb> findTitle(@Param("sjId") Integer sjId);

    //商家---加载行程编号
    public List<Order> findOrderSid();

    //订单页面：加载信息
    public List<Order> findOrder(@Param("id") Integer id);

    //订单页面：提交添加联系人
    public int addSubscribePeople(SubscribePeople subscribePeople);

    //订单页面：添加游客信息
    public int addPeopleInfo(PeopleInfo peopleInfo);

    //订单页面：根据行程编号查询显示信息
    public List<RouteJb> findRouteInfo(@Param("id") Integer id);

    //后台：详细信息显示（根据行程发布Id获得基本Id）
    public Integer findRoute_issued(@Param("id") Integer sid);

    //查询联系人信息
    public List<SubscribePeople> findSubscribePeople(@Param("O_id") Integer oid);

    //查询游客信息
    public List<PeopleInfo> findPeopleInfo(@Param("O_id") Integer oid);

    //我的订单页面
    //分页查询所有订单
    List<Order> ListByPage(@Param("index") Integer index, @Param("size") Integer size, @Param("status") String status, @Param("uid") Integer uid);

    int CountByPage(@Param("status") String status, @Param("uid") Integer uid);


    /**
     * 订单详细信息页面
     *
     */

    //#根据订单编号查询信息
    public List<Order> findInfo(@Param("id") Integer id);

    //修改联系人信息   根据订单编号修改
    public int updateSubscribePeople(SubscribePeople subscribePeople);

    //修改游客信息	根据游客姓名修改
    public int updatePeopleInfo(PeopleInfo peopleInfo);

}
